<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form action="http://localhost:3000/api/phonelogin" method="post">
        <div>
            <input type="text" placeholder="验证码" name="captcha">
            <img src="http://localhost:3000/api/captcha" width="150" height="50" alt="" id="img">
        </div>
        <div>
            <input type="text" name="phone" placeholder="请输入手机号">
            <input type="button" value="获取手机验证码">
        </div>
        <div>
            <input type="text" name="phonecode" placeholder="短信验证码">
        </div>
        <div>
            <input type="submit" value="提交">
        </div>
    </form>
    <script>
        var oImg = document.querySelector("#img")
        oImg.onclick = function () {
            oImg.src = "http://localhost:3000/api/captcha?t=" + new Date().getTime()
        }
    </script>
</body>

</html>